package com.xiangyu.demo.filter;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import java.io.IOException;

/**
 * java类简单作用描述
 *
 * @ProjectName: springboot-demo
 * @Package: com.xiangyu.demo.filter
 * @Description: java类作用描述
 * @Author: 向羽
 * @CreateDate: 2018/1/19 14:11
 * @UpdateUser: 向羽
 * @UpdateDate: 2018/1/19 14:11
 * @UpdateRemark: The modified content
 * @Version: 2.0
 */
@Order(1)
@Component
@WebFilter(urlPatterns = "/*")
public class CustomFilter2 implements Filter {
    private Logger logger = LoggerFactory.getLogger(CustomFilter2.class);
    @Override
    public void init(FilterConfig filterConfig) throws ServletException {

    }

    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        logger.debug("=======");
        filterChain.doFilter(servletRequest,servletResponse);
    }

    @Override
    public void destroy() {

    }
}
